home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / c / icu-1.3.1 / icu-bin / include / unicode.h < prev    next >
C/C++ Source or Header  |  2000-02-23  |  23KB  |  656 lines

  1. /*
  2. *****************************************************************************************
  3. *                                                                                       *
  4. * COPYRIGHT:                                                                            *
  5. *   (C) Copyright Taligent, Inc.,  1996, 1997                                           *
  6. *   (C) Copyright International Business Machines Corporation,  1996- 1999              *
  7. *   Licensed Material - Program-Property of IBM - All Rights Reserved.                  *
  8. *   US Government Users Restricted Rights - Use, duplication, or disclosure             *
  9. *   restricted by GSA ADP Schedule Contract with IBM Corp.                              *
  10. *                                                                                       *
  11. *****************************************************************************************
  12. */
  13. //  Copyright (C) 1996-1997 Taligent, Inc. All rights reserved.
  14. //
  15. //  FILE NAME : unicode.h
  16. //
  17. //  CREATED
  18. //      Wednesday, December 11, 1996
  19. //
  20. //  CREATED BY
  21. //      Helena Shih
  22. //
  23. //  CHANGES
  24. //      Thursday, April 15, 1999
  25. //      Modified the definitions of all the functions
  26. //      C++ Wrappers for Unicode
  27. //  CHANGES BY
  28. //      Madhu Katragadda
  29. //   5/20/99     Madhu        Added the function getVersion()
  30. //********************************************************************************************
  31.    
  32.          
  33.  
  34. #ifndef UNICODE_H
  35. #define UNICODE_H
  36.  
  37. #include "utypes.h"
  38.  
  39.  
  40. /**
  41.  * The Unicode class allows you to query the properties associated with individual 
  42.  * Unicode character values.  
  43.  * <p>
  44.  * The Unicode character information, provided implicitly by the 
  45.  * Unicode character encoding standard, includes information about the sript 
  46.  * (for example, symbols or control characters) to which the character belongs,
  47.  * as well as semantic information such as whether a character is a digit or 
  48.  * uppercase, lowercase, or uncased.
  49.  * <P>
  50.  * @subclassing Do not subclass.
  51.  */
  52. class U_COMMON_API Unicode
  53. {
  54. public:
  55.     /**
  56.      * The minimum value a UChar can have.  The lowest value a
  57.      * UChar can have is 0x0000.
  58.      */
  59.     static const UChar   MIN_VALUE;
  60.  
  61.     /**
  62.      * The maximum value a UChar can have.  The greatest value a
  63.      * UChar can have is 0xffff.
  64.      */
  65.     static const UChar   MAX_VALUE;
  66.  
  67.     /**
  68.      * Public data for enumerated Unicode general category types
  69.      */
  70.  
  71.     enum EUnicodeGeneralTypes
  72.     {
  73.         UNASSIGNED              = 0,
  74.         UPPERCASE_LETTER        = 1,
  75.         LOWERCASE_LETTER        = 2,
  76.         TITLECASE_LETTER        = 3,
  77.         MODIFIER_LETTER         = 4,
  78.         OTHER_LETTER            = 5,
  79.         NON_SPACING_MARK        = 6,
  80.         ENCLOSING_MARK          = 7,
  81.         COMBINING_SPACING_MARK  = 8,
  82.         DECIMAL_DIGIT_NUMBER    = 9,
  83.         LETTER_NUMBER           = 10,
  84.         OTHER_NUMBER            = 11,
  85.         SPACE_SEPARATOR         = 12,
  86.         LINE_SEPARATOR          = 13,
  87.         PARAGRAPH_SEPARATOR     = 14,
  88.         CONTROL                 = 15,
  89.         FORMAT                  = 16,
  90.         PRIVATE_USE             = 17,
  91.         SURROGATE               = 18,
  92.         DASH_PUNCTUATION        = 19,
  93.         START_PUNCTUATION       = 20,
  94.         END_PUNCTUATION         = 21,
  95.         CONNECTOR_PUNCTUATION   = 22,
  96.         OTHER_PUNCTUATION       = 23,
  97.         MATH_SYMBOL             = 24,
  98.         CURRENCY_SYMBOL         = 25,
  99.         MODIFIER_SYMBOL         = 26,
  100.         OTHER_SYMBOL            = 27,
  101.         INITIAL_PUNCTUATION     = 28,
  102.         FINAL_PUNCTUATION       = 29,
  103.         GENERAL_TYPES_COUNT     = 30
  104.     };
  105.  
  106.     enum EUnicodeScript 
  107.     {
  108.         kBasicLatin,
  109.         kLatin1Supplement,
  110.         kLatinExtendedA,
  111.         kLatinExtendedB,
  112.         kIPAExtension,
  113.         kSpacingModifier,
  114.         kCombiningDiacritical,
  115.         kGreek,
  116.         kCyrillic,
  117.         kArmenian,
  118.         kHebrew,
  119.         kArabic,
  120.         kDevanagari,
  121.         kBengali,
  122.         kGurmukhi,
  123.         kGujarati,
  124.         kOriya,
  125.         kTamil,
  126.         kTelugu,
  127.         kKannada,
  128.         kMalayalam,
  129.         kThai,
  130.         kLao,
  131.         kTibetan,
  132.         kGeorgian,
  133.         kHangulJamo,
  134.         kLatinExtendedAdditional,
  135.         kGreekExtended,
  136.         kGeneralPunctuation,
  137.         kSuperSubScript,
  138.         kCurrencySymbolScript,
  139.         kSymbolCombiningMark,
  140.         kLetterlikeSymbol,
  141.         kNumberForm,
  142.         kArrow,
  143.         kMathOperator,
  144.         kMiscTechnical,
  145.         kControlPicture,
  146.         kOpticalCharacter,
  147.         kEnclosedAlphanumeric,
  148.         kBoxDrawing,
  149.         kBlockElement,
  150.         kGeometricShape,
  151.         kMiscSymbol,
  152.         kDingbat,
  153.         kCJKSymbolPunctuation,
  154.         kHiragana,
  155.         kKatakana,
  156.         kBopomofo,
  157.         kHangulCompatibilityJamo,
  158.         kKanbun,
  159.         kEnclosedCJKLetterMonth,
  160.         kCJKCompatibility,
  161.         kCJKUnifiedIdeograph,
  162.         kHangulSyllable,
  163.         kHighSurrogate,
  164.         kHighPrivateUseSurrogate,
  165.         kLowSurrogate,
  166.         kPrivateUse,
  167.         kCJKCompatibilityIdeograph,
  168.         kAlphabeticPresentation,
  169.         kArabicPresentationA,
  170.         kCombiningHalfMark,
  171.         kCJKCompatibilityForm,
  172.         kSmallFormVariant,
  173.         kArabicPresentationB,
  174.         kNoScript,
  175.         kHalfwidthFullwidthForm,
  176.         kScriptCount
  177.     };
  178.  
  179.     /**
  180.      * This specifies the language directional property of a character set.
  181.      */
  182.     enum EDirectionProperty { 
  183.         LEFT_TO_RIGHT               = 0, 
  184.         RIGHT_TO_LEFT               = 1, 
  185.         EUROPEAN_NUMBER             = 2,
  186.         EUROPEAN_NUMBER_SEPARATOR   = 3,
  187.         EUROPEAN_NUMBER_TERMINATOR  = 4,
  188.         ARABIC_NUMBER               = 5,
  189.         COMMON_NUMBER_SEPARATOR     = 6,
  190.         BLOCK_SEPARATOR             = 7,
  191.         SEGMENT_SEPARATOR           = 8,
  192.         WHITE_SPACE_NEUTRAL         = 9, 
  193.         OTHER_NEUTRAL               = 10, 
  194.         LEFT_TO_RIGHT_EMBEDDING     = 11,
  195.         LEFT_TO_RIGHT_OVERRIDE      = 12,
  196.         RIGHT_TO_LEFT_ARABIC        = 13,
  197.         RIGHT_TO_LEFT_EMBEDDING     = 14,
  198.         RIGHT_TO_LEFT_OVERRIDE      = 15,
  199.         POP_DIRECTIONAL_FORMAT      = 16,
  200.         DIR_NON_SPACING_MARK        = 17,
  201.         BOUNDARY_NEUTRAL            = 18
  202.     };
  203.     
  204.     /**
  205.      * Values returned by the getCellWidth() function.
  206.      * @see Unicode#getCellWidth
  207.      */
  208.     enum ECellWidths
  209.     {
  210.         ZERO_WIDTH              = 0,
  211.         HALF_WIDTH              = 1,
  212.         FULL_WIDTH              = 2,
  213.         NEUTRAL                 = 3
  214.     };
  215.  
  216.    /**
  217.      * Determines whether the specified UChar is a lowercase character
  218.      * according to Unicode 2.1.2.
  219.      *
  220.      * @param ch    the character to be tested
  221.      * @return  true if the character is lowercase; false otherwise.
  222.      *
  223.      * @see Unicode#isUpperCase
  224.      * @see Unicode#isTitleCase
  225.      * @see Unicode#toLowerCase
  226.      */
  227.     static  bool_t          isLowerCase(UChar     ch);
  228.  
  229.     /**
  230.      * Determines whether the specified character is an uppercase character
  231.      * according to Unicode 2.1.2.
  232.      *
  233.      * @param ch    the character to be tested
  234.      * @return  true if the character is uppercase; false otherwise.
  235.      * @see Unicode#isLowerCase
  236.      * @see Unicode#isTitleCase
  237.      * @see Unicode#toUpperCase
  238.      */
  239.     static  bool_t          isUpperCase(UChar ch);
  240.  
  241.     /**
  242.      * Determines whether the specified character is a titlecase character
  243.      * according to Unicode 2.1.2.
  244.      *
  245.      * @param ch    the character to be tested
  246.      * @return  true if the character is titlecase; false otherwise.
  247.      * @see Unicode#isUpperCase
  248.      * @see Unicode#isLowerCase
  249.      * @see Unicode#toTitleCase
  250.      */
  251.     static  bool_t          isTitleCase(UChar ch);
  252.  
  253.     /**
  254.      * Determines whether the specified character is a digit according to Unicode
  255.      * 2.1.2.
  256.      *
  257.      * @param ch    the character to be tested
  258.      * @return  true if the character is a digit; false otherwise.
  259.      */
  260.     static  bool_t          isDigit(UChar ch);
  261.  
  262.     /**
  263.      * Determines whether the specified numeric value is actually a defined character
  264.      * according to Unicode 2.1.2.
  265.      *
  266.      * @param ch    the character to be tested
  267.      * @return  true if the character has a defined Unicode meaning; false otherwise.
  268.      *
  269.      * @see Unicode#isDigit
  270.      * @see Unicode#isLetter
  271.      * @see Unicode#isLetterOrDigit
  272.      * @see Unicode#isUpperCase
  273.      * @see Unicode#isLowerCase
  274.      * @see Unicode#isTitleCase
  275.      */
  276.     static  bool_t          isDefined(UChar       ch);
  277.  
  278.     /**
  279.      * Determines whether the specified character is a control character according 
  280.      * to Unicode 2.1.2.
  281.      *
  282.      * @param ch    the character to be tested
  283.      * @return  true if the Unicode character is a control character; false otherwise.
  284.      *
  285.      * @see Unicode#isPrintable
  286.      */
  287.     static  bool_t          isControl(UChar ch);
  288.  
  289.     /**
  290.      * Determines whether the specified character is a printable character according 
  291.      * to Unicode 2.1.2.
  292.      *
  293.      * @param ch    the character to be tested
  294.      * @return  true if the Unicode character is a printable character; false otherwise.
  295.      *
  296.      * @see Unicode#isControl
  297.      */
  298.     static  bool_t          isPrintable(UChar ch);
  299.  
  300.     /**
  301.      * Determines whether the specified character is of the base form according 
  302.      * to Unicode 2.1.2.
  303.      *
  304.      * @param ch    the character to be tested
  305.      * @return  true if the Unicode character is of the base form; false otherwise.
  306.      *
  307.      * @see Unicode#isLetter
  308.      * @see Unicode#isDigit
  309.      */
  310.  
  311.      static  bool_t          isBaseForm(UChar ch);
  312.     /**
  313.      * Determines whether the specified character is a letter
  314.      * according to Unicode 2.1.2.
  315.      *
  316.      * @param ch    the character to be tested
  317.      * @return  true if the character is a letter; false otherwise.
  318.      *
  319.      *
  320.      * @see Unicode#isDigit
  321.      * @see Unicode#isLetterOrDigit
  322.      * @see Unicode#isUpperCase
  323.      * @see Unicode#isLowerCase
  324.      * @see Unicode#isTitleCase
  325.      */
  326.     static  bool_t          isLetter(UChar        ch);
  327.  
  328.     /**
  329.      * A convenience method for determining if a Unicode character
  330.      * is allowed as the first character in a Java identifier.
  331.      * <P>
  332.      * A character may start a Java identifier if and only if
  333.      * it is one of the following:
  334.      * <ul>
  335.      * <li>  a letter
  336.      * <li>  a currency symbol (such as "$")
  337.      * <li>  a connecting punctuation symbol (such as "_").
  338.      * </ul>
  339.      *
  340.      * @param   ch  the Unicode character.
  341.      * @return  TRUE if the character may start a Java identifier;
  342.      *          FALSE otherwise.
  343.      * @see     isJavaIdentifierPart
  344.      * @see     isLetter
  345.      * @see     isUnicodeIdentifierStart
  346.      */
  347.     static bool_t isJavaIdentifierStart(UChar ch);
  348.  
  349.     /**
  350.      * A convenience method for determining if a Unicode character 
  351.      * may be part of a Java identifier other than the starting
  352.      * character.
  353.      * <P>
  354.      * A character may be part of a Java identifier if and only if
  355.      * it is one of the following:
  356.      * <ul>
  357.      * <li>  a letter
  358.      * <li>  a currency symbol (such as "$")
  359.      * <li>  a connecting punctuation character (such as "_").
  360.      * <li>  a digit
  361.      * <li>  a numeric letter (such as a Roman numeral character)
  362.      * <li>  a combining mark
  363.      * <li>  a non-spacing mark
  364.      * <li>  an ignorable control character
  365.      * </ul>
  366.      * 
  367.      * @param   ch  the Unicode character.
  368.      * @return  TRUE if the character may be part of a Unicode identifier; 
  369.      *          FALSE otherwise.
  370.      * @see     isIdentifierIgnorable
  371.      * @see     isJavaIdentifierStart
  372.      * @see     isLetter
  373.      * @see     isDigit
  374.      * @see     isUnicodeIdentifierPart
  375.      */
  376.     static bool_t isJavaIdentifierPart(UChar ch);
  377.  
  378.     /**
  379.      * A convenience method for determining if a Unicode character 
  380.      * is allowed to start in a Unicode identifier.
  381.      * A character may start a Unicode identifier if and only if
  382.      * it is a letter.
  383.      *
  384.      * @param   ch  the Unicode character.
  385.      * @return  TRUE if the character may start a Unicode identifier;
  386.      *          FALSE otherwise.
  387.      * @see     isJavaIdentifierStart
  388.      * @see     isLetter
  389.      * @see     isUnicodeIdentifierPart
  390.      */
  391.     static bool_t isUnicodeIdentifierStart(UChar ch);
  392.  
  393.     /**
  394.      * A convenience method for determining if a Unicode character
  395.      * may be part of a Unicode identifier other than the starting
  396.      * character.
  397.      * <P>
  398.      * A character may be part of a Unicode identifier if and only if
  399.      * it is one of the following:
  400.      * <ul>
  401.      * <li>  a letter
  402.      * <li>  a connecting punctuation character (such as "_").
  403.      * <li>  a digit
  404.      * <li>  a numeric letter (such as a Roman numeral character)
  405.      * <li>  a combining mark
  406.      * <li>  a non-spacing mark
  407.      * <li>  an ignorable control character
  408.      * </ul>
  409.      * 
  410.      * @param   ch  the Unicode character.
  411.      * @return  TRUE if the character may be part of a Unicode identifier;
  412.      *          FALSE otherwise.
  413.      * @see     isIdentifierIgnorable
  414.      * @see     isJavaIdentifierPart
  415.      * @see     isLetterOrDigit
  416.      * @see     isUnicodeIdentifierStart
  417.      */
  418.     static bool_t isUnicodeIdentifierPart(UChar ch);
  419.  
  420.     /**
  421.      * A convenience method for determining if a Unicode character 
  422.      * should be regarded as an ignorable character in a Java 
  423.      * identifier or a Unicode identifier.
  424.      * <P>
  425.      * The following Unicode characters are ignorable in a Java identifier
  426.      * or a Unicode identifier:
  427.      * <table>
  428.      * <tr><td>0x0000 through 0x0008,</td>
  429.      *                                 <td>ISO control characters that</td></tr>
  430.      * <tr><td>0x000E through 0x001B,</td> <td>are not whitespace</td></tr>
  431.      * <tr><td>and 0x007F through 0x009F</td></tr>
  432.      * <tr><td>0x200C through 0x200F</td>  <td>join controls</td></tr>
  433.      * <tr><td>0x200A through 0x200E</td>  <td>bidirectional controls</td></tr>
  434.      * <tr><td>0x206A through 0x206F</td>  <td>format controls</td></tr>
  435.      * <tr><td>0xFEFF</td>               <td>zero-width no-break space</td></tr>
  436.      * </table>
  437.      * 
  438.      * @param   ch  the Unicode character.
  439.      * @return  TRUE if the character may be part of a Unicode identifier;
  440.      *          FALSE otherwise.
  441.      * @see     isJavaIdentifierPart
  442.      * @see     isUnicodeIdentifierPart
  443.      */
  444.     static bool_t isIdentifierIgnorable(UChar ch);
  445.  
  446.     /**
  447.      * The given character is mapped to its lowercase equivalent according to
  448.      * Unicode 2.1.2; if the character has no lowercase equivalent, the character 
  449.      * itself is returned.
  450.      * <P>
  451.      * A character has a lowercase equivalent if and only if a lowercase mapping
  452.      * is specified for the character in the Unicode 2.0 attribute table.
  453.      * <P>
  454.      * Unicode::toLowerCase() only deals with the general letter case conversion.
  455.      * For language specific case conversion behavior, use UnicodeString::toLower().
  456.      * For example, the case conversion for dot-less i and dotted I in Turkish,
  457.      * or for final sigma in Greek.
  458.      *
  459.      * @param ch    the character to be converted
  460.      * @return  the lowercase equivalent of the character, if any;
  461.      *      otherwise the character itself.
  462.      *
  463.      * @see UnicodeString#toLower
  464.      * @see Unicode#isLowerCase
  465.      * @see Unicode#isUpperCase
  466.      * @see Unicode#toUpperCase
  467.      * @see Unicode#toTitleCase
  468.      */
  469.    static   UChar         toLowerCase(UChar     ch); 
  470.  
  471.     /**
  472.      * The given character is mapped to its uppercase equivalent according to Unicode
  473.      * 2.1.2; if the character has no uppercase equivalent, the character itself is 
  474.      * returned.
  475.      * <P>
  476.      * Unicode::toUpperCase() only deals with the general letter case conversion.
  477.      * For language specific case conversion behavior, use UnicodeString::toUpper().
  478.      * For example, the case conversion for dot-less i and dotted I in Turkish,
  479.      * or ess-zed (i.e., "sharp S") in German.
  480.      *
  481.      * @param ch    the character to be converted
  482.      * @return  the uppercase equivalent of the character, if any;
  483.      *      otherwise the character itself.
  484.      *
  485.      * @see UnicodeString#toUpper
  486.      * @see Unicode#isUpperCase
  487.      * @see Unicode#isLowerCase
  488.      * @see Unicode#toLowerCase
  489.      * @see Unicode#toTitleCase
  490.      */
  491.     static  UChar         toUpperCase(UChar     ch);
  492.  
  493.     /**
  494.      * The given character is mapped to its titlecase equivalent according to Unicode
  495.      * 2.1.2.  There are only four Unicode characters that are truly titlecase forms
  496.      * that are distinct from uppercase forms.  As a rule, if a character has no
  497.      * true titlecase equivalent, its uppercase equivalent is returned.
  498.      * <P>
  499.      * A character has a titlecase equivalent if and only if a titlecase mapping
  500.      * is specified for the character in the Unicode 2.1.2 data.
  501.      *
  502.      * @param ch    the character to be converted
  503.      * @return  the titlecase equivalent of the character, if any;
  504.      *      otherwise the character itself.
  505.      * @see Unicode#isTitleCase
  506.      * @see Unicode#toUpperCase
  507.      * @see Unicode#toLowerCase
  508.      */
  509.     static  UChar             toTitleCase(UChar     ch);
  510.  
  511.     /**
  512.      * Determines if the specified character is a Unicode space character
  513.      * according to Unicode 2.1.2.
  514.      *
  515.      * @param ch    the character to be tested
  516.      * @return  true if the character is a space character; false otherwise.
  517.      */
  518.     static  bool_t              isSpaceChar(UChar     ch);
  519.  
  520.    /**
  521.      * Returns a value indicating a character category according to Unicode
  522.      * 2.1.2.
  523.      * @param ch            the character to be tested
  524.      * @return a value of type int, the character category.
  525.      * @see Unicode#UNASSIGNED
  526.      * @see Unicode#UPPERCASE_LETTER
  527.      * @see Unicode#LOWERCASE_LETTER
  528.      * @see Unicode#TITLECASE_LETTER
  529.      * @see Unicode#MODIFIER_LETTER
  530.      * @see Unicode#OTHER_LETTER
  531.      * @see Unicode#NON_SPACING_MARK
  532.      * @see Unicode#ENCLOSING_MARK
  533.      * @see Unicode#COMBINING_SPACING_MARK
  534.      * @see Unicode#DECIMAL_DIGIT_NUMBER
  535.      * @see Unicode#OTHER_NUMBER
  536.      * @see Unicode#SPACE_SEPARATOR
  537.      * @see Unicode#LINE_SEPARATOR
  538.      * @see Unicode#PARAGRAPH_SEPARATOR
  539.      * @see Unicode#CONTROL
  540.      * @see Unicode#PRIVATE_USE
  541.      * @see Unicode#SURROGATE
  542.      * @see Unicode#DASH_PUNCTUATION
  543.      * @see Unicode#OPEN_PUNCTUATION
  544.      * @see Unicode#CLOSE_PUNCTUATION
  545.      * @see Unicode#CONNECTOR_PUNCTUATION
  546.      * @see Unicode#OTHER_PUNCTUATION
  547.      * @see Unicode#LETTER_NUMBER
  548.      * @see Unicode#MATH_SYMBOL
  549.      * @see Unicode#CURRENCY_SYMBOL
  550.      * @see Unicode#MODIFIER_SYMBOL
  551.      * @see Unicode#OTHER_SYMBOL
  552.      */
  553.     static  int8_t          getType(UChar     ch);
  554.  
  555.     /**
  556.      * Returns the linguistic direction property of a character.
  557.      * <P>
  558.      * Returns the linguistic direction property of a character.
  559.      * For example, 0x0041 (letter A) has the LEFT_TO_RIGHT directional 
  560.      * property.
  561.      * @see #EDirectionProperty
  562.      */
  563.     static EDirectionProperty characterDirection(UChar ch);
  564.  
  565.     /**
  566.      * Returns the script associated with a character.
  567.      * @see #EUnicodeScript
  568.      */
  569.     static EUnicodeScript    getScript(UChar    ch);
  570.  
  571.     /**
  572.      * Returns a value indicating the display-cell width of the character
  573.      * when used in Asian text, according to the Unicode standard (see p. 6-130
  574.      * of The Unicode Standard, Version 2.0).  The results for various characters
  575.      * are as follows:
  576.      * <P>
  577.      *      ZERO_WIDTH: Characters which are considered to take up no display-cell space:
  578.      *          control characters
  579.      *          format characters
  580.      *          line and paragraph separators
  581.      *          non-spacing marks
  582.      *          combining Hangul jungseong
  583.      *          combining Hangul jongseong
  584.      *          unassigned Unicode values
  585.      * <P>
  586.      *      HALF_WIDTH: Characters which take up half a cell in standard Asian text:
  587.      *          all characters in the General Scripts Area except combining Hangul choseong
  588.      *              and the characters called out specifically above as ZERO_WIDTH
  589.      *          alphabetic and Arabic presentation forms
  590.      *          halfwidth CJK punctuation
  591.      *          halfwidth Katakana
  592.      *          halfwidth Hangul Jamo
  593.      *          halfwidth forms, arrows, and shapes
  594.      * <P>
  595.      *      FULL_WIDTH:  Characters which take up a full cell in standard Asian text:
  596.      *          combining Hangul choseong
  597.      *          all characters in the CJK Phonetics and Symbols Area
  598.      *          all characters in the CJK Ideographs Area
  599.      *          all characters in the Hangul Syllables Area
  600.      *          CJK compatibility ideographs
  601.      *          CJK compatibility forms
  602.      *          small form variants
  603.      *          fullwidth ASCII
  604.      *          fullwidth punctuation and currency signs
  605.      * <P>
  606.      *      NEUTRAL:  Characters whose cell width is context-dependent:
  607.      *          all characters in the Symbols Area, except those specifically called out above
  608.      *          all characters in the Surrogates Area
  609.      *          all charcaters in the Private Use Area
  610.      * <P>
  611.      * For Korean text, this algorithm should work properly with properly normalized Korean
  612.      * text.  Precomposed Hangul syllables and non-combining jamo are all considered full-
  613.      * width characters.  For combining jamo, we treat we treat choseong (initial consonants)
  614.      * as double-width characters and junseong (vowels) and jongseong (final consonants)
  615.      * as non-spacing marks.  This will work right in text that uses the precomposed
  616.      * choseong characters instead of teo choseong characters in a row, and which uses the
  617.      * choseong filler character at the beginning of syllables that don't have an initial
  618.      * consonant.  The results may be slightly off with Korean text following different
  619.      * conventions.
  620.      */
  621.     static uint16_t         getCellWidth(UChar    ch);
  622.  
  623.     /**
  624.      * Retrives the decimal numeric value of a digit character.
  625.      * @param ch the digit character for which to get the numeric value
  626.      * @return the numeric value of ch in decimal radix.  This method returns
  627.      * -1 if ch is not a valid digit character.
  628.      */
  629.     static int32_t            digitValue(UChar ch);     
  630.     
  631.     /**
  632.      * Retrieves the Unicode Standard Version number that is used
  633.      * @return the Unicode Standard Version Number.
  634.      */
  635.     static const char*   getVersion(void);
  636.  
  637. protected:
  638.     // These constructors, destructor, and assignment operator must
  639.     // be protected (not private, as they semantically are) to make
  640.     // various UNIX compilers happy. [LIU]
  641.                             Unicode();
  642.                             Unicode(    const   Unicode&    other);
  643.                             ~Unicode();
  644.     const   Unicode&        operator=(  const   Unicode&    other);
  645.  
  646.  
  647.  
  648. };
  649.  
  650.  
  651. #endif
  652.  
  653.  
  654.  
  655.  
  656.